package nl.boektrust.btsoep.shared.model;

/*
 * ONIX PR 2.1 list 21
 */
public enum EditionTypeCode {
	UNDEFINED, REGULAR, ILLUSTRATED, ABRIDGED, ADAPTED, ALTERNATE, ANNOTATED, BILINGUAL, BRAILLE, CRITICAL, COURSEPACK, ENLARGED, EXPURGATED,
	FACSIMILE, LARGE, MICROPRINT, MEDIA_TIE_IN, MULTILINGUAL, REVISED, SCHOOL, 
	SIMPLIFIED, SPECIAL, STUDENT, TEACHER, UNABRIDGED, ULTRA_LARGE_PRINT, UNEXPURGATED, VARIORUM;
	
	public static String stringValue(EditionTypeCode t) {
		String value = new String();
		switch (t) {
		case UNDEFINED: value = "Onbekend"; break;
		case REGULAR: value = "Nieuwe"; break;
		case ILLUSTRATED: value = "Geillustreerde"; break;
		case ABRIDGED: value = "Verkorte"; break;
		case ADAPTED: value = "Aangepaste"; break;
		case ALTERNATE: value = "Alternatieve"; break;
		case ANNOTATED: value = "Geannoteerde"; break;
		case BILINGUAL: value = "Tweetalige"; break;
		case BRAILLE: value = "Braille"; break;
		case CRITICAL: value = "Kritische"; break;
		case COURSEPACK: value = "Coursepack"; break;
		case ENLARGED: value = "Uitgebreide"; break;
		case EXPURGATED: value = "Gecensureerde"; break;
		case FACSIMILE: value = "Facsimile"; break;
		case LARGE: value = "Vergrote"; break;
		case MICROPRINT: value = "Microprint"; break;
		case MEDIA_TIE_IN: value = "Media tie-in"; break;
		case MULTILINGUAL: value = "Meertalige"; break;
		case REVISED: value = "Herziene"; break;
		case SCHOOL: value = "Schooluitgave"; break;
		case SIMPLIFIED: value = "Gesimplificeerde"; break;
		case SPECIAL: value = "Speciale"; break;
		case STUDENT: value = "Studenten"; break;
		case TEACHER: value = "Docenten"; break;
		case UNABRIDGED: value = "Onverkorte"; break;
		case ULTRA_LARGE_PRINT: value = "Extra grote"; break;
		case UNEXPURGATED: value = "Ongecensureerde"; break;
		case VARIORUM: value = "Variorum"; break;
		
		}
		return value;

	}
	
	public static EditionTypeCode parseStringIntoEditionTypeCode(String s) {
		for (EditionTypeCode t : EditionTypeCode.values()) {
			if (EditionTypeCode.stringValue(t).equals(s) == true) return t;
		}
		return UNDEFINED;
	}

	public static String stringValueForOnix(EditionTypeCode t) {
		String value = new String();
		if (t == null) {
			System.err.println("EditionTypeCode.stringValueForOnix() was called with a null argument");
			return null;
		}
		switch (t) {
		case UNDEFINED: value = null; break;
		case REGULAR: value = "NED"; break;
		case ILLUSTRATED: value = "ILL"; break;
		case ABRIDGED: value = "ABR"; break;
		case ADAPTED: value = "ADP"; break;
		case ALTERNATE: value = "ALT"; break;
		case ANNOTATED: value = "ANN"; break;
		case BILINGUAL: value = "BLL"; break;
		case BRAILLE: value = "BRL"; break;
		case CRITICAL: value = "CRI"; break;
		case COURSEPACK: value = "CSP"; break;
		case ENLARGED: value = "ENL"; break;
		case EXPURGATED: value = "EXP"; break;
		case FACSIMILE: value = "FAC"; break;
		case LARGE: value = "LTE"; break;
		case MICROPRINT: value = "MCP"; break;
		case MEDIA_TIE_IN: value = "MDT"; break;
		case MULTILINGUAL: value = "MLL"; break;
		case REVISED: value = "REV"; break;
		case SCHOOL: value = "SCH"; break;
		case SIMPLIFIED: value = "SMP"; break;
		case SPECIAL: value = "SPE"; break;
		case STUDENT: value = "STU"; break;
		case TEACHER: value = "TCH"; break;
		case UNABRIDGED: value = "UBR"; break;
		case ULTRA_LARGE_PRINT: value = "ULP"; break;
		case UNEXPURGATED: value = "UXP"; break;
		case VARIORUM: value = "VAR"; break;
		}
		return value;
	}
		
	
	

}
